//
//  FPDesignHomeHeaderView.m
//  ForestPack
//
//  Created by jimmy on 2018/7/6.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "FPDesignHomeHeaderView.h"
#import "UIView+Utils.h"

@implementation FPDesignHomeHeaderView

- (UIView *)setHeaderView
{
    UIView * headerView = [[UIView alloc] init];
    headerView.size = CGSizeMake(SCREEN_WIDTH, 200);
    headerView.backgroundColor = TestrandomColor;
    
    UIImageView *bjImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200)];
    bjImageView.image = [UIImage imageNamed:@"头部背景暗"];
    bjImageView.userInteractionEnabled = YES;
    [headerView addSubview:bjImageView];
    
    UIButton *messageButton = [UIButton buttonWithType:UIButtonTypeCustom];
    messageButton.frame = CGRectMake(SCREEN_WIDTH - 44, 30, 22, 21);
    [messageButton setImage:[UIImage imageNamed:@"消息"] forState:UIControlStateNormal];
//    [messageButton addTarget:self action:@selector(messageClick) forControlEvents:UIControlEventTouchUpInside];
    [headerView addSubview:messageButton];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.frame = CGRectMake(headerView.left + 150, headerView.top + 50, 75, 20);
    titleLabel.text = @"天天特惠";
    titleLabel.font = [UIFont fontWithName:@"MicrosoftYaHei" size:18];
    titleLabel.textColor = RGB_COLOR(255,255,255);
    [headerView addSubview:titleLabel];
    
    UILabel *desLabel= [[UILabel alloc] init];
    desLabel.frame = CGRectMake(headerView.left + 99, titleLabel.bottom + 10, 190, 13);
    desLabel.text = @"设计/营销/修图，创意服务一元起";
    desLabel.font = [UIFont systemFontOfSize:12];
    desLabel.textColor = RGB_COLOR(255,255,255);
    [headerView addSubview:desLabel];
    
    UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(20, desLabel.bottom + 20, 40, 28)];
    UIImageView *leftImage = [[UIImageView alloc] initWithFrame:CGRectMake(12, 4, 22, 22)];
    leftImage.image = [UIImage imageNamed:@"搜索白色"];
    [leftView addSubview:leftImage];
    [bjImageView addSubview:leftView];
    
    UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 26 - 15 - 22, desLabel.bottom + 20, 22, 22)];
    [bjImageView addSubview:rightView];
    UIImageView *rightImage = [[UIImageView alloc] initWithFrame:CGRectMake(12, 4, 22, 22)];
    rightImage.image = [UIImage imageNamed:@"扫一扫"];
    [rightView addSubview:rightImage];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = rightView.bounds;
    [rightImage addSubview:button];
//    [button addTarget:self action:@selector(scanningClick) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *bjButton = [UIButton buttonWithType:UIButtonTypeCustom];
    bjButton.frame = CGRectMake(13, desLabel.bottom + 20, SCREEN_WIDTH - 26, 30);
    [bjButton setTitle:@"搜索您需要的人才，如包装设计等" forState:UIControlStateNormal];
    [bjButton setTitleColor:RGB_COLOR(255,255,255) forState:UIControlStateNormal];
    bjButton.titleLabel.font = [UIFont systemFontOfSize:12];
    bjButton.titleLabel.textAlignment = NSTextAlignmentLeft;
    bjButton.layer.cornerRadius = 15;
    bjButton.clipsToBounds = YES;
    bjButton.backgroundColor = RGBACOLOR(243,243,243,0.6);
//    [bjButton addTarget:self action:@selector(searchClick) forControlEvents:UIControlEventTouchUpInside];
    [headerView addSubview:bjButton];
    
    
    //    UITextField *searchField = [[UITextField alloc] init];
    //    searchField.frame = CGRectMake(13, desLabel.bottom + 20, SCREEN_WIDTH - 26, 30);
    //    searchField.placeholder = @"搜索您需要的人才，如包装设计等";
    //    searchField.font = [UIFont systemFontOfSize:12];
    //    searchField.leftView = leftView;
    //    searchField.rightView = rightView;
    //    searchField.leftViewMode = UITextFieldViewModeAlways;
    //    searchField.layer.cornerRadius = 15;
    //    searchField.clipsToBounds = YES;
    //    searchField.delegate = self;
    //    searchField.backgroundColor = RGBACOLOR(243,243,243,0.6);
    //    searchField.returnKeyType = UIReturnKeySearch;
    //    [headerView addSubview:searchField];
    
    return headerView;
}


@end
